<!--
 * @description: 
 * @LastEditTime: 2024-04-09 14:18:02
-->
<template>
  <view class="banner">
    <u-swiper
      :list="list"
      keyName="cover"
      showTitle
      :autoplay="false"
      circular
      height="360rpx"
      @click="handleClickNav"
    ></u-swiper>
    <view class="more" @click="handleMore">更多</view>
  </view>
</template>

<script>
export default {
  props: {
    list: {
      type: Array,
      default: () => [],
    },
  },
  data() {
    return {}
  },
  methods: {
    handleClickNav(bannerIndex) {
      const clickItem = this.list[bannerIndex]
      uni.setStorageSync('notice-detail', clickItem)
      this.$routeUtils.navigateTo({
        url: `/pages/index/noticeDetail?id=${clickItem.id}`,
      })
    },
    handleMore() {
      this.$routeUtils.navigateTo({
        url: `/pages/index/notice`,
      })
    },
  },
}
</script>

<style lang="scss" scoped>
.banner {
  position: relative;
  .more {
    position: absolute;
    top: 0;
    right: 0;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10rpx 20rpx;
    border-radius: 0 0 0 10rpx;
  }
}
</style>
